<?php
/**
 * CodeModel
 * 
 * @author Admin
 * @version 
 */
require_once 'Zend/Db/Table/Abstract.php';
class Wap_Models_GroupEventModel extends Zend_Db_Table_Abstract
{
    /**
     * The default table name 
     */
    protected $_name = 'tbl_groupnote';
    protected $_primary = 'GroupNoteID';
    
    function listGroupMain(){
        //$arrParam['userID']='3EWVZLROJK';
    	$db = Zend_Db_Table::getDefaultAdapter();
    	$mySql = $db->select()
    				->from(array('grp'	=> $this->_name),array("*"))
    				->where('grp.main_event = 1 and grp.active = 1')
                    ->order('ordering asc');
    	$result = $db->fetchAll($mySql);
    	return $result;
    }

    function getDetailGroup($gid){
        //$arrParam['userID']='3EWVZLROJK';
        $db = Zend_Db_Table::getDefaultAdapter();
        $mySql = $db->select()
                    ->from(array('grp'  => $this->_name),array("*"))
                    ->where('grp.GroupNoteID = ?', $gid);                    
        $result = $db->fetchRow($mySql);
        return $result;
    }
    
    function getCategoryNote($gid){
        $db = Zend_Db_Table::getDefaultAdapter();
        $mySql = $db->select()
                    ->from($this->_name)
                    ->where('GroupNoteID=?', $gid);
    //echo $mySql;die;
        $result = $db->fetchRow($mySql);
        return $result;
    }
}